package com.xiaoma.tpo.resource;


public enum ChapterCategory {

    C1(1,"海洋生物学"),C2(2,"欧洲历史"),C3(3,"生态学"),C4(4,"生物学"),C5(5,"商业"),
    
    C6(6,"音乐史"),C7(7,"心理学"),C8(8,"地质学"),C9(9,"语言学"),C10(10,"天文学"),
    
    C11(11,"环境科学"),C12(12,"文学"),C13(13,"艺术史"),C14(14,"考古学");
    
    private int code;
    private String text;
    
    private ChapterCategory(int code, String text){
        this.code = code;
        this.text = text;
    }
    
    public String getText() {
        return this.text;
    }
    
    public int getCode() {
        return this.code;
    }
    
    public static String code2Text(int code) {
        switch(code){
        case 1: 
            return ChapterCategory.C1.getText();
        case 2: 
            return ChapterCategory.C2.getText();
        case 3: 
            return ChapterCategory.C3.getText();
        case 4: 
            return ChapterCategory.C4.getText();
        case 5: 
            return ChapterCategory.C5.getText();
        case 6: 
            return ChapterCategory.C6.getText();
        case 7: 
            return ChapterCategory.C7.getText();
        case 8: 
            return ChapterCategory.C8.getText();
        case 9: 
            return ChapterCategory.C9.getText();
        case 10: 
            return ChapterCategory.C10.getText();
        case 11: 
            return ChapterCategory.C11.getText();
        case 12: 
            return ChapterCategory.C12.getText();
        case 13: 
            return ChapterCategory.C13.getText();
        case 14: 
            return ChapterCategory.C14.getText();
        default:
            return "";
        }
    }
}
